package cn.dujc.superkid.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author du
 * date 2018/7/29 下午1:03
 */
public class MyClassResult extends ListDataEntity implements Parcelable {
    
    private List<MyClass> list;

    public List<MyClass> getList() { return list;}

    public void setList(List<MyClass> list) { this.list = list;}

    @Override
    public int describeContents() { return 0; }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeTypedList(this.list);
    }

    public MyClassResult() {}

    protected MyClassResult(Parcel in) {
        super(in);
        this.list = in.createTypedArrayList(MyClass.CREATOR);
    }

    public static final Creator<MyClassResult> CREATOR = new Creator<MyClassResult>() {
        @Override
        public MyClassResult createFromParcel(Parcel source) {return new MyClassResult(source);}

        @Override
        public MyClassResult[] newArray(int size) {return new MyClassResult[size];}
    };

    public static class MyClass implements Parcelable{
        /**
         * id : 90
         * class_id : 39
         * class_title : 有理数
         * course_num : 15
         * study_num : 0
         * cover : http://api.niuwaketang.com/cover/4.png
         */

        private String id;//记录id
        private String class_id;//课程id
        private String class_title;//课程名
        private String course_num;//课程数量
        private String study_num;//学习人数
        private String cover;//封面图片

        public String getId() { return id;}

        public void setId(String id) { this.id = id;}

        public String getClass_id() { return class_id;}

        public void setClass_id(String class_id) { this.class_id = class_id;}

        public String getClass_title() { return class_title;}

        public void setClass_title(String class_title) { this.class_title = class_title;}

        public String getCourse_num() { return course_num;}

        public void setCourse_num(String course_num) { this.course_num = course_num;}

        public String getStudy_num() { return study_num;}

        public void setStudy_num(String study_num) { this.study_num = study_num;}

        public String getCover() { return cover;}

        public void setCover(String cover) { this.cover = cover;}

        @Override
        public int describeContents() { return 0; }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.class_id);
            dest.writeString(this.class_title);
            dest.writeString(this.course_num);
            dest.writeString(this.study_num);
            dest.writeString(this.cover);
        }

        public MyClass() {}

        protected MyClass(Parcel in) {
            this.id = in.readString();
            this.class_id = in.readString();
            this.class_title = in.readString();
            this.course_num = in.readString();
            this.study_num = in.readString();
            this.cover = in.readString();
        }

        public static final Creator<MyClass> CREATOR = new Creator<MyClass>() {
            @Override
            public MyClass createFromParcel(Parcel source) {return new MyClass(source);}

            @Override
            public MyClass[] newArray(int size) {return new MyClass[size];}
        };
    }

}
